package org.stwy.lease.rent;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;
import org.stwy.lease.contract.ContractEntity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.rap.common.annotation.MetaData;
import com.rap.common.entity.AuditableEntity;
import com.rap.common.entity.BaseEntity;

/**
*版权信息 (c) RAP 保留所有权利.
*@author Rap.Codegen
*@Team RAP Team
*@Date 2015-4-25 12:31:24
*<p></p>
*
*@参与人：Rap.Codegen
*/
 
@MetaData(value = "租金收缴")
@Entity
@Table(name = "stwy_rent")
@DynamicInsert
@DynamicUpdate
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class RentEntity extends AuditableEntity {
	private static final long serialVersionUID = 1L;
	
	@MetaData(value = "合同")
	@ManyToOne(optional=false)
	@JoinColumn(name = "contractId")
	private ContractEntity contract;
	
	@MetaData(value = "是否已发放",comments="默认未发放" )
	@Column(nullable = false)
	private Integer hasPay=0;
	
	@MetaData(value = "应缴日期",comments="" )
	@Column(nullable = false)
	private Date shouldPayDate;
	
	@MetaData(value = "租金日期起",comments="" )
	@Column(nullable = false)
	private Date beginDate;
	
	@MetaData(value = "租金日期至",comments="" )
	@Column(nullable = false)
	private Date endDate;
	
	@MetaData(value = "应缴金额",comments="" )
	@Column(nullable = false)
	private Double shouldPayMoney;
	
	@MetaData(value = "补交租金",comments="" )
	@Column(nullable = true)
	private Double repayMoney=0d;
	
	@MetaData(value = "预付租金",comments="" )
	@Column(nullable = true)
	private Double prepayMoney=0d;
	
	@MetaData(value = "实际收缴日期",comments="" )
	@Column(nullable = true)
	private Date payDate;
	
	@MetaData(value = "实际收缴金额",comments="" )
	@Column(nullable = true)
	private Double money;
	
	@MetaData(value = "历史欠费合计",comments="" )
	@Column(nullable = true)
	private Double history;
	
	@MetaData(value = "租赁保证金本月交",comments="" )
	@Column(nullable = true)
	private Double depositNow;
	
	@MetaData(value = "租赁保证金历史交",comments="" )
	@Column(nullable = true)
	private Double depositHistory=0d;
	
	@MetaData(value = "备注",comments="" )
	@Column(nullable = true,length = 1000)
	private String remark;
	
	@MetaData(value = "是否初始租金",comments="" )
	private Boolean isInit=false;
	
	@MetaData(value = "结余",comments="" )
	private Double leave = 0d;
	
	
	public ContractEntity getContract() {
		return contract;
	}
	public void setContract(ContractEntity contract) {
		this.contract = contract;
	}
	/**
	 * 租金收缴日期
	 */
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
	public Date getPayDate(){
		return this.payDate;
	}
	public void setPayDate(Date payDate){
		this.payDate = payDate;
	}
	/**
	 * 收缴金额
	 */
	public Double getMoney(){
		return this.money;
	}
	
	public void setMoney(Double money){
		this.money = money;
	}
	/**
	 * 历史欠费合计
	 */
	public Double getHistory(){
		return this.history;
	}
	public void setHistory(Double history){
		this.history = history;
	}
	/**
	 * 租赁保证金本月交
	 */
	public Double getDepositNow(){
		return this.depositNow;
	}
	public void setDepositNow(Double depositNow){
		this.depositNow = depositNow;
	}
	/**
	 * 租赁保证金历史交
	 */
	public Double getDepositHistory(){
		return this.depositHistory;
	}
	public void setDepositHistory(Double depositHistory){
		this.depositHistory = depositHistory;
	}
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
	public Date getShouldPayDate() {
		return shouldPayDate;
	}
	public void setShouldPayDate(Date shouldPayDate) {
		this.shouldPayDate = shouldPayDate;
	}
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
	public Date getBeginDate() {
		return beginDate;
	}
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	public Double getShouldPayMoney() {
		return shouldPayMoney;
	}
	public void setShouldPayMoney(Double shouldPayMoney) {
		this.shouldPayMoney = shouldPayMoney;
	}
	/**
	 * 备注
	 */
	public String getRemark(){
		return this.remark;
	}
	public void setRemark(String remark){
		this.remark = remark;
	}
	
	public Boolean getIsInit() {
		return isInit;
	}
	public void setIsInit(Boolean isInit) {
		this.isInit = isInit;
	}
	public Integer getHasPay() {
		return hasPay;
	}
	public void setHasPay(Integer hasPay) {
		this.hasPay = hasPay;
	}
	public Double getRepayMoney() {
		return repayMoney;
	}
	public void setRepayMoney(Double repayMoney) {
		this.repayMoney = repayMoney;
	}
	public Double getPrepayMoney() {
		return prepayMoney;
	}
	public void setPrepayMoney(Double prepayMoney) {
		this.prepayMoney = prepayMoney;
	}
	public Double getLeave() {
		return leave;
	}
	public void setLeave(Double leave) {
		this.leave = leave;
	}
	
}
